package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-18
 * Time: 16:46
 */
class A {
    public void test1() {
        System.out.println("A::test1()");
    }
}
interface IA {
    void test2();
}
public class Test {
    public static void main(String[] args) {
        IA ia = new IA() {
            @Override
            public void test2() {
                System.out.println("匿名内部类的test2方法...");
            }
        };
        ia.test2();



        /*new A(){
            @Override
            public void test1() {
                System.out.println("内部类的test1()....");
            }
        }.test1();*/
    }
    public static void test() {
        System.out.println("test()...");
    }
}
